package com.stone.controller;

import com.stone.client.ProduceClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @description: 库存控制器类
 * @author: zoubaolu
 * @date: 2022年06月23日 9:33
 */
@RestController
@RequestMapping("/consume")
@Slf4j
public class ConsumeController {

    @Resource
    private ProduceClient produceClient;

    @Value("${test.content}")
    private String content;

    @GetMapping("/test")
    public String descStock() {
        log.info("descStock content {}", content);
        return "hello world";
    }

    @GetMapping("/remote-call")
    public String remoteCall() {
        log.info("remoteCall");
        return produceClient.function();
    }

}
